package com.itcat.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itcat.api.mysql.SmsHomeRecommendProductApi;
import com.itcat.mysql.pojo.SmsHomeNewProduct;
import com.itcat.mysql.pojo.SmsHomeRecommendProduct;
import com.itcat.service.SmsHomeRecommendProductService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SmsHomeRecommendProductServiceImpl implements SmsHomeRecommendProductService {

    @DubboReference
    private SmsHomeRecommendProductApi smsHomeRecommendProductApi;

    @Override
    public Page<SmsHomeRecommendProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) {
        Page<SmsHomeRecommendProduct> list = smsHomeRecommendProductApi.list(productName, recommendStatus, pageSize, pageNum);
        return list;
    }

    @Override
    public void create(List<SmsHomeRecommendProduct> smsHomeRecommendProducts) {
        smsHomeRecommendProductApi.create(smsHomeRecommendProducts);
    }

    @Override
    public void delete(List<Integer> ids) {
        smsHomeRecommendProductApi.delete(ids);
    }

    @Override
    public void updateRecommendStatus(List<Integer> ids, Integer recommendStatus) {
        smsHomeRecommendProductApi.updateRecommendStatus(ids,recommendStatus);
    }

    @Override
    public void updateSort(Integer id, Integer sort) {
        smsHomeRecommendProductApi.updateSort(id,sort);
    }
}
